<!--
/**************************************************
* @(#)ordertempinputwz.jsp
*
* Copyright (c) 2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/02/08, SimonyiPeng
*  1) first release
/**************************************************
-->
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page import="java.util.*"%>
<%@ include file="../../../common.jsp" %>
<html>
<head>
<title>应急采购信息录入</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<LINK href="<%=root%>/css/caigouxitong.css" type=text/css rel=stylesheet>
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/calendar2.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/string.js"></SCRIPT>
</head>

<%
ArrayList deptList = new ArrayList();
ArrayList addrList = new ArrayList();

ArrayList bcList = (ArrayList)request.getAttribute("balancecategory");
ArrayList ary = (ArrayList)request.getAttribute("organdaddr");
deptList = (ArrayList)ary.get(0);
addrList = (ArrayList)ary.get(1);

//配送方式
ArrayList deliverModeList = (ArrayList)request.getAttribute("deliverModeList");
if (deliverModeList == null) deliverModeList = new ArrayList();

//结算方式
ArrayList balanceModeList = (ArrayList)request.getAttribute("balanceModeList");
if (balanceModeList == null) balanceModeList = new ArrayList();

//备注字段长度
int memoLen = 800;
%>


<script language='javascript'>

    <%
        //如果点击"保存并新增"按钮，在此作出保存成功提示
        if(request.getAttribute("SUCCESSMSG") != null)
            out.print("alert('"+request.getAttribute("SUCCESSMSG")+"');");
    %>
    
    
    
    var deptlist = new Array();
    var addrlist = new Array();
    var addrlisttemp ;
    //初始化
    <%for(int i=0;i<deptList.size();i++){%>
        deptlist[<%=i%>] = '<%=deptList.get(i)%>';
        <%ArrayList addrListTemp = (ArrayList)addrList.get(i);%>
        addrlisttemp = new Array();
        <%for(int j=0;j<addrListTemp.size();j++){%>
            addrlisttemp[<%=j%>] = '<%=addrListTemp.get(j)%>';          
        <%}%>
        addrlist[<%=i%>] = addrlisttemp;
    <%}%>

    function resetrow(rownum){
        document.getElementById('concentricityid'+rownum).value="";
        document.getElementById('concentricityid_'+rownum).value="";
        document.getElementById('manufactureid'+rownum).value="";
        document.getElementById('manufacturename'+rownum).innerHTML="<div align='center' class='txt_content'>&nbsp;</div>";
        document.getElementById('ordercount'+rownum).value="";
        document.getElementById('spec'+rownum).innerHTML = "<div align='center' class='txt_content'>&nbsp;</div>";
        document.getElementById('type'+rownum).innerHTML = "<div align='center' class='txt_content'>&nbsp;</div>";
        document.getElementById('brand'+rownum).innerHTML = "<div align='center' class='txt_content'>&nbsp;</div>";
        document.getElementById('quantunit'+rownum).innerHTML = "<div align='center' class='txt_content'>&nbsp;</div>";
        document.getElementById('sum'+rownum).innerHTML = "<div align='center' class='txt_content'>&nbsp;</div>";
        document.getElementById('signinprice'+rownum).value="";
        document.getElementById('divmode'+rownum).innerText="";
        document.getElementById('mode'+rownum).value="";
        if(rownum == 1){
            document.all.providerid.options[0].selected = true;
            var length = document.all.providerid.length;
            for (i=1;i<length;i++)
            {
                eval("document.all.providerid.options["+(length-i)+"]=null;");
            }
        }
        else{
            document.getElementById('providerid'+rownum).innerHTML = "<div align='center' class='txt_content'>&nbsp;</div>";
        }
        calTotalSum();
    }
    
    function changeDeliverAddrByDept(){
        var deptid=eval('document.all.deptid.selectedIndex;');
        var deliveraddr = document.getElementById('deliveraddr');
        var length=deliveraddr.length;
        for (i=1;i<length;i++)
        {
            eval("document.all.deliveraddr.options["+(length-i)+"]=null;");
            document.getElementById('linkman_').value = "";
            document.getElementById('linktel_').value = "";
            document.getElementById('signinperson').value="";
        }
        //当选择了订货部门
        if(deptid!=0){
            var addrTemp = addrlist[deptid-1];
            for(i=0;i<addrTemp.length;i++){
                var msg = addrTemp[i];
                var sz = StringTokenize(msg,'|',0,null);
                var tempoption;
                tempoption=new  Option(sz[1],sz[1]);
                
                if(sz[2]==null) sz[2]="";
                if(sz[3]==null) sz[3]="";
                eval('document.all.deliveraddr.options[i+1]=tempoption;');
                if(addrTemp.length==1){
                    eval('document.all.deliveraddr.options[i+1].selected=true;');
                    changeDeliverAddr();
                }
            }
        }
    }
    
    function changeDeliverAddr(){
        var deptindex = document.getElementById('deptid').selectedIndex;
        var addrTemp = addrlist[deptindex-1];
        var msg = addrTemp[document.getElementById('deliveraddr').selectedIndex-1];

        var sz = StringTokenize(msg,'|',0,null);
        if(sz[2]==null) sz[2]="";
        if(sz[3]==null) sz[3]="";
        document.getElementById('linkman_').value=sz[2];
        document.getElementById('linktel_').value=sz[3];
        document.getElementById('signinperson').value=sz[2];
        
    }
    

    
    function submitForm(option){
        if("SA" == option){
            document.all.saveoption.value="SA";
        }
        if("S" == option){
            document.all.saveoption.value="S";
        }
        //if(ivmanuf()){
        //  if(checkNoneableValue()){
                document.form1.action='<%=response.encodeURL(root+"/A160102.do")%>';
                form1.submit();
        //  }
        //}
    }
    
    function checkNoneableValue(){
        var currentrownum = document.getElementById('currentrownum').value;
        var deptid = document.getElementById("deptid").value;
        var deliveraddr = document.getElementById("deliveraddr").value;
        var delivermode = document.getElementById("delivermode").value;
        var delivermode_ = document.getElementById("delivermode_").value;
        var balancemode = document.getElementById("balancemode").value;
        var balancemode_ = document.getElementById("balancemode_").value;
        var delivergoodsid = document.getElementById("delivergoodsid").value;
        var signindate = document.getElementById("signindate").value;
        var signinperson = document.getElementById("signinperson").value;
        
        var linkm = document.getElementById("linkman_").value;
        var linkt = document.getElementById("linktel_").value;
        var balancecategory = document.getElementsByName("balancecategory");
        var checkedBC = null;
        for(i=0;i<balancecategory.length;i++){
            if(balancecategory[i].checked){
                checkedBC = balancecategory[i].value;
            }
        }
        
        if(deptid == null || deptid == "") {
            alert("请确认订货单位已经选择");return false;
        }
        if(deliveraddr == null || deliveraddr == ""){
            alert("请确认送货地址已经选择");   return false;
        }       
        if(delivermode == '2' && delivermode_ == ""){
            alert("请确认配送方式已经选择");   return false;
        }
        if(balancemode == '2' && balancemode_ == ""){
            alert("请确认结算方式已经选择");   return false;
        }
        if(delivergoodsid == null || delivergoodsid == ""){
            alert("请确认送货单号已经选择");   return false;
        }
        if(signindate == null || signindate == ""){
            alert("请确认签收日期已经选择");   return false;
        }
        if(signinperson == null || signinperson == ""){
            alert("请确认签收人已经选择");    return false;
        }   
        if(checkedBC == null){
            alert("请确认结算分类已经选择");return false;
        }

        var sum = 0;
        for(i=1;i<=10;i++){
            var concentricityid = document.getElementById("concentricityid"+i).value;
            var ordercount = document.getElementById("ordercount"+i).value;
            var manufactureid = document.getElementById("manufactureid"+i).value;
            var signinprice = document.getElementById("signinprice"+i).value;
            
            if(concentricityid != null && concentricityid != "") 
            {
                if(manufactureid == null || manufactureid == "")
                {
                    alert("请确认输入集中编码后已经选定产品");  
                    return false;
                }
                if(ordercount == null || ordercount == "")
                {
                    alert("请确认签收数量已经输入");   
                    return false;
                }
                if(!isFloatNum(ordercount))
                {
                    alert("请确认输入的签收数量为数字"); 
                    return false;
                }
                else
                {
                    if(ordercount<=0) 
                    {
                        alert("签收数量必须大于0");                     
                        return false;
                    }   
                }
                if(signinprice == null || signinprice == "")
                {
                    alert("请确认价格已经输入"); 
                    return false;
                }
                if(!isFloatNum(signinprice))
                {
                    alert("请确认输入的价格为数字");   
                    return false;
                }
            }
            else
            {
                resetrow(i);
                sum = sum + i;
            }
        
        }
        if(sum == 55){
            alert("应急采购单必须至少录入一条产品明细");
            return false;
        }       
        return true;
    }
    
    function inputManufacture(){
        var url = "<%=response.encodeURL(root+"/jsp/ordersystem/manufactureinsert.jsp")%>";;
        var returnv = window.open(url,null," edge: sunken ; center: Yes; help: No; resizable: No; status: No; dialogWidth: 840px ; dialogHeight: 720px ; scroll:yes");
    }
    
    function checkManufacture(rownum){
        var concentricityid = document.getElementById("concentricityid"+rownum).value;
        if(concentricityid == "" || concentricityid == null)
            return false;
        var providerid = document.getElementById("providerid").value;
        resetrow(rownum);
        document.getElementById("concentricityid"+rownum).value = concentricityid;
        document.all('iframe1').src="<%=response.encodeURL(root+"/jsp/iframe/checkManufactureTemp.jsp")%>?rownum="+rownum+"&concentricityid="+concentricityid+"&providerid="+providerid;
        
        return false;
    }
    
    function checkDeliverGoodsId(){
        var delivergoodsid = document.getElementById("delivergoodsid").value;
        if  (event.keyCode==13){  
            if (delivergoodsid == "" || delivergoodsid == null || isEmpty(delivergoodsid)){
                document.getElementById("delivergoodsid").value = "";
                return false;           
            }
                
            document.all('iframe1').src="<%=response.encodeURL(root+"/jsp/iframe/checkdelivergoodsid.jsp")%>?&delivergoodsid="+delivergoodsid;
                
        }   
        keydown2("signindate");
    }
    
    function inputNewManufacture(){
        document.form1.action='/A100103';
        form1.submit();
    }
    
    function selectManufacture(index){
        var providerid = document.getElementById("providerid").value;
        if(index == 1){//如果是第一行，则始终不带providerid进行查询
            providerid = "";
        }
        if(index != "1" && (providerid == "" || providerid == null)){
            alert("请先选择供应商");
            return false;
        }
        resetrow(index);
        
        document.getElementById('currentrownum').value = index;
        var url="<%=response.encodeURL(root+"/A160199.do")%>?providerid=" + providerid;
        var returnv = window.open(url,null," center=Yes, help=No, resizable=Yes, status=Yes, width=960px, height=680px, scrollbars=yes");       
    }

    function createOrderCode(){
        alert("检查是否必输项都输入了");
        //document.all('iframe1').src="<%=response.encodeURL(root+"/jsp/iframe/createorderid.jsp")%>";
        return false;
    }
    
    function jsfschange(){
        var val = document.getElementById('balancemode');
        for(var i=0; i<val.options.length; i++) {
            if(val.options[i].selected && val.options[i].value == "205") {
                if(confirm('是否确认手工输入结算方式?')){
                    document.getElementById('balancemode_').style.display='';
                    document.getElementById('balancemode').style.display='none';
                }else{
                    alert("请重新选择结算方式");
                    val.options[0].selected = true;
                }
            }
        }
    }

    function psfschange(){
        var val = document.getElementById('delivermode');
        for(var i=0; i<val.options.length; i++) {
            if(val.options[i].selected && val.options[i].value == "104") {
                if(confirm('是否确认手工输入配送方式?')){
                    document.getElementById('delivermode_').style.display='';
                    document.getElementById('delivermode').style.display='none';
                }else{
                    alert("请重新选择配送方式");
                    val.options[0].selected = true;
                }
            }
        }
    }   
    
    function checkconcentricityid(index){
        if  (event.keyCode==13){  
            if (checkiscontentricityidexist(index))
                checkManufacture(index);
        }
        keydown2("ordercount"+index);
    }
    
    function checkiscontentricityidexist(index){
        var value = document.getElementById('concentricityid'+index).value;
        for(i=1;i<=10;i++){
            var val = document.getElementById('concentricityid'+i).value;
            if(value == val && index != i && value !=''){
                alert("集中编码输入重复！");
                document.getElementById('concentricityid'+index).value="";
                return false;
            }
        }
        return true;
    }
    
    function ivmanuf(){
        if(document.getElementById("providerid").value==null || document.getElementById("providerid").value==""){
            alert("请先选择供应商");
            return false;
        }
        for(i=1;i<=10;i++){
            var v1 = document.getElementById('concentricityid'+i).value;
            if(v1 == null || v1.length == 0) continue; 
            for(j=1;j<=10;j++){ 
                if(j!=i){
                    var v2 = document.getElementById('concentricityid'+j).value;
                    if(v1 == v2){
                        alert("集中编码输入不正确，请核实！");
                        return false;
                    }
                }
            }
        }
        return true;
    }
    
    function deleteOtherRow(){
        for(i=2;i<=10;i++){
            if(document.getElementById("concentricityid"+i).value != ""){
                alert("请先删除除第一条产品外的其它产品，再修改供应商");
                document.getElementById("providerid").options[0].selected=true;
                document.getElementById("referenceprice1").value="";
                document.getElementById("signinprice1").value="";
                return false;
            }
        }
        var price1buffer = document.getElementById("price1buffer").value;
        var providerid = document.getElementById("providerid").value;
        var aaa = document.getElementById("providerid").options;
        var selected = 0;
        for(i=0;i<aaa.length;i++){
            if(aaa[i].selected == true){
                selected = i;
            }
        }
        if(selected == 0) {
            document.getElementById("referenceprice1").value="";
            document.getElementById("signinprice1").value="0";
        }
        var a1 = tokenize(price1buffer,"|");
        for(i=0;i<a1.length;i++){
            var a2 = tokenize(a1[i],":");
            if(providerid == a2[0] && selected == i+1){
                <%
                if (GSSystemConfigurator.getParam("gs.SetManufactureCode13").equalsIgnoreCase("true"))
                {
                %>
                    document.getElementById("concentricityid1").value = a2[2];
                    document.getElementById("concentricityid_1").value = a2[2];
                    document.getElementById("manufactureid1").value = a2[3];
                <%
                }
                %>
                
                document.getElementById("signinprice1").value = a2[1];
                document.getElementById("referenceprice1").value = a2[1];
                document.getElementById("mode1").value = a2[4];
                if(a2[4]=='<%=GSBaseConstants.BALANCE_MODE1%>'){
                    document.getElementById("divmode1").innerText='<%=DefineDic.getBalanceMode(GSBaseConstants.BALANCE_MODE1)%>';
                }else{
                    document.getElementById("divmode1").innerText='<%=DefineDic.getBalanceMode(GSBaseConstants.BALANCE_MODE2)%>';
                }
                checkSignPrice(1);
                return ;
            }
        }
        
        calTotalSum();
    }
    
    function setFocus(){
        document.all.deptid.focus();
    }
    
    function showMsg(balancecategoryno){
<%
    for(int bcs = 0;bcs < bcList.size();bcs++){
        GSBalanceCategoryBean bcBean = (GSBalanceCategoryBean)bcList.get(bcs);
%>
        if(<%=bcBean.getGs_balance_category_no()%> == balancecategoryno){
            document.getElementById("bcName").value = '<%=bcBean.getGs_balance_category_name()%>';
        }
<%      
    }
%>
    }   
</script>

<body leftmargin="0" topmargin="0" bgcolor="#f5f5f5" onload='setFocus();'>
<input type='hidden' name='currmenu' value='1601'>
<center>

<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="1" class="mtxt_black">&nbsp;</td>
          <td height="30" width="758" class="mtxt_black" >应急采购信息录入</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>

<br>


<form name="form1" id="form1" method="post"  style="visibility: visible;">
<input type='hidden' name='saveoption' value=''>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr> 
        <td> 
            <table class=bg_table id=tableId    cellspacing=1 cellpadding=2 width=100% align=center border=0>
                <tbody> 
                <tr class="bg_column" height=20> 
                        <td align="center" colspan="11">应急采购单总体信息</td>
                </tr>
               
                <tr class="bg_row_odd" height=20> 
                    <td class=top align="center"> 
                        <div align="center" class="txt_content">订货单位</div>
                    </td>
                    <td class=top align=center> 
                        <div align='left' class='txt_content'> 
                            <select id='deptid' name='deptid' onChange='changeDeliverAddrByDept();' onKeyDown="keydown2('delivermode')">
                                <option value='' selected>请选择..</option>
                            <%
                            for(int i=0;i<deptList.size();i++){
                                String dept = (String)deptList.get(i);
                                StringTokenizer st = new StringTokenizer(dept,"|");
                                String[] tmp = new String[2] ;
                                int index =0;
                                while(st.hasMoreElements()){
                                    tmp[index++] = (String)st.nextElement();
                                }
                            %>
                                <option value='<%=tmp[0]%>' <%if(deptList.size()==1) out.print("selected");%>><%=tmp[1]%></option>
                            <%
                            }
                            %>
                            </select><font color='red'>&nbsp;*</font>
                        </div>
                    </td>
                    <td class=top align=left> 
                        <div align="center" class="txt_content">配送方式</div>
                    </td>
                    <td class=top align="center" > 
                        <div align='left' class='txt_content'> 
                            <select id='delivermode' name='delivermode' onchange="psfschange();" onKeyDown="keydown2('balancemode')">
                                <!--原
                                <option value='1'>送货上门</option>
                                <option value='2'>其他</option>
                                -->
                                <%
                                //新修改
                                for (int i=0;i<deliverModeList.size();i++)
                                {
                                    com.hitrust.gs.bean.GSDictionaryBean dictionary = (com.hitrust.gs.bean.GSDictionaryBean) deliverModeList.get(i);
                                %>  
                                    <option value="<%=dictionary.getId()%>"><%=dictionary.getName()%></option>
                                <%  
                                }
                                %>                              
                            </select><font color='red'>&nbsp;*</font>
                        </div>
                        <div align='left' class='txt_content' > 
                            <input type="text" id='delivermode_' name='delivermode_' size="8" value='' style='display:none'>
                        </div>                        
                    </td>
                    <td class=top align="center"> 
                        <div align="center" class="txt_content" style="display:none;">结算方式</div>
                    </td>
                    <td class=top align="center" > 
                        <div align='left' class='txt_content'  style="display:none;"> 
                            <select id='balancemode' name='balancemode' onchange="jsfschange();" onKeyDown="keydown2('delivergoodsid')">
                                <!--原
                                <option value='1'>定期结算</option>
                                <option value='2'>其他</option>
                                -->
                                <%
                                //新修改
                                for (int i=0;i<balanceModeList.size();i++)
                                {
                                    com.hitrust.gs.bean.GSDictionaryBean dictionary = (com.hitrust.gs.bean.GSDictionaryBean) balanceModeList.get(i);
                                %>  
                                    <option value="<%=dictionary.getId()%>"><%=dictionary.getName()%></option>
                                <%  
                                }
                                %>                              
                            </select><font color='red'>&nbsp;*</font>
                        </div>
                        <div align='left' class='txt_content' > 
                            <input type="text" id='balancemode_' name='balancemode_' size="8" value='' style='display:none'>
                        </div>
                    </td>

                </tr>

                <tr class="bg_row_odd" height=20> 
                    <td class=top align="center"> 
                        <div align="center" class="txt_content">送货单号</div>
                    </td>
                    <td class=top align="center"> 
                        <div align='left' class='txt_content'> 
                            <input type='text' id='delivergoodsid' size='13' name='delivergoodsid' onKeyDown="checkDeliverGoodsId()"><font color='red'>&nbsp;*</font>
                        </div>
                    </td>
                    <td class=top align="center"> 
                        <div align="center" class="txt_content">签收日期</div>
                    </td>
                    
                    <td class=top align="center" nowrap > 
                        <div align='left' class='txt_content'> 
                            <input type='text' id='signindate' size='13' name='signindate' value='<%=DateUtil.getCurrentDate("yyyy-MM-dd")%>' readonly onfocus="setday(this,document.getElementById('signinperson'))" onKeyDown="keydown2('signinperson')"><font color='red'>&nbsp;*</font>
                        </div>
                    </td>
                    <td class=top align="center"> 
                        <div align="center" class="txt_content">签收人</div>
                    </td>
                    
                    <td class=top align="center" nowrap > 
                        <div align='left' class='txt_content'> 
                            <input type='text' id='signinperson' size='13' name='signinperson' value='' onKeyDown="keydown2('deliveraddr')"><font color='red'>&nbsp;*</font>
                        </div>
                    </td>                
                </tr>
                                
                <tr class="bg_row_odd" height=20> 
                    <td class=top align="center"> 
                        <div align="center" class="txt_content">送货地址</div>
                    </td>
                    <td class=top align="center"> 
                        <div align='left' class='txt_content'> 
                            <select id='deliveraddr' name='deliveraddr' onChange='changeDeliverAddr();' onKeyDown="keydown2('linkman_')">
                                <option value=''>请选择..</option>
                                <%if(deptList.size()==1){%><script language='javascript'>changeDeliverAddrByDept();</script><%}%>
                            </select><font color='red'>&nbsp;*</font>
                        </div>
                    </td>
                    <td class=top align="center"> 
                        <div align="center" class="txt_content">联系人 </div>
                    </td>
                    
                    <td class=top align="center" nowrap id='linkman'> 
                        <div align='left' class='txt_content'> 
                            <input type='text' id='linkman_' size='13' name='linkman_' value='' onKeyDown="keydown2('linktel_')">
                        </div>
                    </td>
                    <td class=top align="center"> 
                        <div align="center" class="txt_content">联系电话 </div>
                    </td>
                    
                    <td class=top align="center" nowrap id='linktel'> 
                        <div align='left' class='txt_content'> 
                            <input type='text' id='linktel_' size='13' name='linktel_' value='' onKeyDown='keydown2("balancecategory");'>
                        </div>
                    </td>                
                </tr>
                
                <tr class="bg_row_odd" height=20> 
                    <td class=top align="center"> 
                        <div align="center" class="txt_content">结算分类</div>
                    </td>
                    <td class=top align="center" colspan='5'> 
                        <div align="left" class="txt_content"> 
                        <input type='hidden' name='bcName'>
                        <%if(bcList == null){%>
                            <input type="radio" name="balancecategory" value="0" onKeyDown="keydown2('Textarea1');">零部件
                        <%}else{ 
                            for(int bcsize = 0;bcsize <bcList.size();bcsize++){
                                GSBalanceCategoryBean bcBean = (GSBalanceCategoryBean)bcList.get(bcsize);
                        %>
                            <input type="radio" onclick="showMsg('<%=bcBean.getGs_balance_category_no()%>')" name="balancecategory" value='<%=bcBean.getGs_balance_category_no()%>'  onKeyDown="keydown2('Textarea1');"><%=bcBean.getGs_balance_category_name()%>&nbsp;
                         <%
                                }
                            }
                        %>
                        </div>
                    </td>
                </tr>
                
                <tr class="bg_row_odd" height=20> 
                    <td class=top align="center"> 
                        备注
                    </td>
                    <td class=top align="center" colspan='5'> 
                        <div align="left" class="txt_content"> 
                        <textarea id="Textarea1" style="WIDTH: 100%; HEIGHT: 50px" name="notes" onKeyDown="keydown2('concentricityid1')"></textarea>
                        </div>
                    </td>
                </tr>
                
                </tbody> 
            </table>
        </td>
    </tr>
</table>

<center>

<br>


    <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
        <input type='hidden' id='currentrownum' name='currentrownum' value='1'>
        <tr> 
            <td> 
                <table class=bg_table id=tableId    cellspacing=1 cellpadding=2 width=100% align=center border=0>
                    <tbody> 
                    <tr class="bg_column" height=20> 
                        <td align="center" colspan="13">
                            <div align="center"><b>应急采购单产品录入</b></div>
                            <div id="totalSum" align="right">总价:</div>
                        </td>
                    </tr>
                    
                    <tr class="bg_column" height=20> 
                        <td class=top align="center"> 
                            <div align="center" class="txt_content"></div>
                        </td>
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">集中编码 <font color='red'>&nbsp;*</font></div>
                        </td>
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">产品名称</div>
                        </td>                        
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">规格</div>
                        </td>
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">型号</div>
                        </td>
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">品牌</div>
                        </td>
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">签收数量 <font color='red'>&nbsp;*</font></div>
                        </td>
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">单位 </div>
                        </td>
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">供应商 <font color='red'>&nbsp;*</font></div>
                        </td>
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">价格（元） <font color='red'>&nbsp;*</font></div>
                        </td>
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">签收总价（元） </div>
                        </td>
                        <td class=top align="center"> 
                            <div align="center" class="txt_content"> 结算模式</div>
                        </td>
                    </tr>


<!--第一行-->
                    <tr id='tr1' class="bg_row_even" height=20 > 
                    <input type='hidden' id='manufactureunitprice1' name='manufactureunitprice' value=''>
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">
                                <input type='button' class="kuang" value='重置' onclick='resetrow(1);'>
                            </div>
                        </td>
                        <!--集中编码-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" class="txt_content"> 
                                <input type='text' id='concentricityid1' name='concentricityid' size='16' maxlength='20' onKeyDown='checkconcentricityid(1);'>
                                <input type='button' class="kuang" value='查询' onclick='selectManufacture(1);'>
                                <input type='hidden' id='manufactureid1' name='manufactureid' size='7' maxlength='20'>
                                <input type='hidden' id='concentricityid_1' name='concentricityid_'>
                                <input type='hidden' id='manufacturename_1' >
                                <input type='hidden' id='manufacturespec_1' >
                                <input type='hidden' id='manufacturetype_1' >
                                <input type='hidden' id='manufacturebrand_1' >
                                <input type='hidden' id='manufactureunitprice_1' >
                                <input type='hidden' id='manufacturequantunit_1' >
                            </div>
                        </td>
                        <!--产品名称-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" class="txt_content" id='manufacturename1'> 
                            </div>
                        </td>
                        <!--规格-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="spec1" class="txt_content"> 
                            </div>
                        </td>
                        <!--型号-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="type1" class="txt_content"> 
                            </div>
                        </td>
                        <!--品牌-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="brand1" class="txt_content"> 
                            </div>
                        </td>

                        <!--签收数量-->
                        <td class=top align="center"> 
                            <div align="center" class="txt_content"> 
                                <input type="text" id='ordercount1' name='ordercount' size="8" maxlength="11" onKeyUp="formatordercount(1)" onKeyDown="keydown2('providerid')">
                            </div>
                        </td>
                        <!--单位-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="quantunit1" class="txt_content"> 
                            </div>
                        </td>                        
                        <!--供应商-->
                        <td class=top align="center" nowrap> 
                            <div align="center" class="txt_content">                                
                                <select id='providerid' name='providerid' onChange='deleteOtherRow()' onKeyDown="keydown2('signinprice1')">
                                    <option value=''>---请选择---</option>
                                </select>
                            </div>
                        </td>
                        <!--价格-->
                        <input type="hidden" id='price1buffer' value='' >
                        <input type="hidden" id='referenceprice1' name='referenceprice' size="6" maxlength="11" >
                        <td class=top align="center"> 
                            <div align='center' class='txt_content'> 
                                <input type="text" id='signinprice1' name='signinprice' size="8" maxlength="11" onKeyUp='checkSignPrice(1)' onKeyDown="keydown2('concentricityid2')">
                            </div>
                        </td>
                        <!--签收总价-->
                        <td class="top" align="center">
                            <div align="center" class="txt_content" id="sum1">
                            </div>
                        </td>   
                        <!-- 结算模式 -->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="divmode1" class="txt_content"> 
                            </div><input type="hidden" id="mode1" name="mode">
                        </td>
                    </tr>



<!--第二行-->
                    <tr id='tr2' class="bg_row_odd" height=20 > 
                    <input type='hidden' id='manufactureunitprice2' name='manufactureunitprice' value=''>
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">
                                <input type='button' class="kuang" value='重置' onclick='resetrow(2);'>
                            </div>
                        </td>
                        <!--集中编码-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" class="txt_content"> 
                                <input type='text' id='concentricityid2' name='concentricityid' size='16' maxlength='20' onKeyDown='checkconcentricityid(2);'>
                                <input type='button' class="kuang" value='查询' onclick='selectManufacture(2);'>
                                <input type='hidden' id='manufactureid2' name='manufactureid' size='7' maxlength='20'>
                                <input type='hidden' id='concentricityid_2' name='concentricityid_'>
                                <input type='hidden' id='manufacturename_2' >
                                <input type='hidden' id='manufacturespec_2' >
                                <input type='hidden' id='manufacturetype_2' >
                                <input type='hidden' id='manufacturebrand_2' >
                                <input type='hidden' id='manufactureunitprice_2' >
                                <input type='hidden' id='manufacturequantunit_2' >
                            </div>
                        </td>
                        <!--产品名称-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" class="txt_content" id='manufacturename2'> 
                            </div>
                        </td>
                        <!--规格-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="spec2" class="txt_content"> 
                            </div>
                        </td>
                        <!--型号-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="type2" class="txt_content"> 
                            </div>
                        </td>
                        <!--品牌-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="brand2" class="txt_content"> 
                            </div>
                        </td>

                        <!--签收数量-->
                        <td class=top align="center"> 
                            <div align="center" class="txt_content"> 
                                <input type="text" id='ordercount2' name='ordercount' size="8" maxlength="11" onKeyUp="formatordercount(2)" onKeyDown="keydown2('signinprice2')">
                            </div>
                        </td>
                        <!--单位-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="quantunit2" class="txt_content"> 
                            </div>
                        </td>                        
                        <!--供应商-->
                        <td class=top align="center" nowrap id='providerid2'> 
                            <div align="center" class="txt_content">                                
                                
                            </div>
                        </td>
                        <!--价格-->
                        <input type="hidden" id='referenceprice2' name='referenceprice' size="6" maxlength="11" >
                        <td class=top align="center"> 
                            <div align='center' class='txt_content'> 
                                <input type="text" id='signinprice2' name='signinprice' size="8" maxlength="11" onKeyUp='checkSignPrice(2)' onKeyDown="keydown2('concentricityid3')">
                            </div>
                        </td>
                        <!--签收总价-->
                        <td class="top" align="center">
                            <div align="center" class="txt_content" id="sum2">
                            </div>
                        </td>   
                        <!-- 结算模式 -->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="divmode2" class="txt_content"> 
                            </div><input type="hidden" id="mode2" name="mode">
                        </td>
                    </tr>

<!--第三行-->
                    <tr id='tr3' class="bg_row_even" height=20 > 
                    <input type='hidden' id='manufactureunitprice3' name='manufactureunitprice' value=''>
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">
                                <input type='button' class="kuang" value='重置' onclick='resetrow(3);'>
                            </div>
                        </td>
                        <!--集中编码-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" class="txt_content"> 
                                <input type='text' id='concentricityid3' name='concentricityid' size='16' maxlength='20' onKeyDown='checkconcentricityid(3);'>
                                <input type='button' class="kuang" value='查询' onclick='selectManufacture(3);'>
                                <input type='hidden' id='manufactureid3' name='manufactureid' size='7' maxlength='20'>
                                <input type='hidden' id='concentricityid_3' name='concentricityid_'>
                                <input type='hidden' id='manufacturename_3' >
                                <input type='hidden' id='manufacturespec_3' >
                                <input type='hidden' id='manufacturetype_3' >
                                <input type='hidden' id='manufacturebrand_3' >
                                <input type='hidden' id='manufactureunitprice_3' >
                                <input type='hidden' id='manufacturequantunit_3' >
                            </div>
                        </td>
                        <!--产品名称-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" class="txt_content" id='manufacturename3'> 
                            </div>
                        </td>
                        <!--规格-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="spec3" class="txt_content"> 
                            </div>
                        </td>
                        <!--型号-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="type3" class="txt_content"> 
                            </div>
                        </td>
                        <!--品牌-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="brand3" class="txt_content"> 
                            </div>
                        </td>

                        <!--签收数量-->
                        <td class=top align="center"> 
                            <div align="center" class="txt_content"> 
                                <input type="text" id='ordercount3' name='ordercount' size="8" maxlength="11" onKeyUp="formatordercount(3)" onKeyDown="keydown2('signinprice3')">
                            </div>
                        </td>
                        <!--单位-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="quantunit3" class="txt_content"> 
                            </div>
                        </td>                        
                        <!--供应商-->
                        <td class=top align="center" nowrap id='providerid3'> 
                            <div align="center" class="txt_content">                                
                                
                            </div>
                        </td>
                        <!--价格-->
                        <input type="hidden" id='referenceprice3' name='referenceprice' size="6" maxlength="11" >
                        <td class=top align="center"> 
                            <div align='center' class='txt_content'> 
                                <input type="text" id='signinprice3' name='signinprice' size="8" maxlength="11" onKeyUp='checkSignPrice(3)' onKeyDown="keydown2('concentricityid4')">
                            </div>
                        </td>

                        <!--签收总价-->
                        <td class="top" align="center">
                            <div align="center" class="txt_content" id="sum3">
                            </div>
                        </td>
                        <!-- 结算模式 -->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="divmode3" class="txt_content"> 
                            </div><input type="hidden" id="mode3" name="mode">
                        </td>   
                    </tr>

<!--第四行-->
                    <tr id='tr4' class="bg_row_odd" height=20 > 
                    <input type='hidden' id='manufactureunitprice4' name='manufactureunitprice' value=''>
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">
                                <input type='button' class="kuang" value='重置' onclick='resetrow(4);'>
                            </div>
                        </td>
                        <!--集中编码-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" class="txt_content"> 
                                <input type='text' id='concentricityid4' name='concentricityid' size='16' maxlength='20' onKeyDown='checkconcentricityid(4);'>
                                <input type='button' class="kuang" value='查询' onclick='selectManufacture(4);'>
                                <input type='hidden' id='manufactureid4' name='manufactureid' size='7' maxlength='20'>
                                <input type='hidden' id='concentricityid_4' name='concentricityid_'>
                                <input type='hidden' id='manufacturename_4' >
                                <input type='hidden' id='manufacturespec_4' >
                                <input type='hidden' id='manufacturetype_4' >
                                <input type='hidden' id='manufacturebrand_4' >
                                <input type='hidden' id='manufactureunitprice_4' >
                                <input type='hidden' id='manufacturequantunit_4' >
                            </div>
                        </td>
                        <!--产品名称-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" class="txt_content" id='manufacturename4'> 
                            </div>
                        </td>
                        <!--规格-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="spec4" class="txt_content"> 
                            </div>
                        </td>
                        <!--型号-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="type4" class="txt_content"> 
                            </div>
                        </td>
                        <!--品牌-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="brand4" class="txt_content"> 
                            </div>
                        </td>

                        <!--签收数量-->
                        <td class=top align="center"> 
                            <div align="center" class="txt_content"> 
                                <input type="text" id='ordercount4' name='ordercount' size="8" maxlength="11" onKeyUp="formatordercount(4)" onKeyDown="keydown2('signinprice4')">
                            </div>
                        </td>
                        <!--单位-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="quantunit4" class="txt_content"> 
                            </div>
                        </td>                        
                        <!--供应商-->
                        <td class=top align="center" nowrap id='providerid4'> 
                            <div align="center" class="txt_content">                                
                                
                            </div>
                        </td>
                        <!--价格-->
                        <input type="hidden" id='referenceprice4' name='referenceprice' size="6" maxlength="11" >
                        <td class=top align="center"> 
                            <div align='center' class='txt_content'> 
                                <input type="text" id='signinprice4' name='signinprice' size="8" maxlength="11" onKeyUp='checkSignPrice(4)' onKeyDown="keydown2('concentricityid5')">
                            </div>
                        </td>

                        <!--签收总价-->
                        <td class="top" align="center">
                            <div align="center" class="txt_content" id="sum4">
                            </div>
                        </td>
                        <!-- 结算模式 -->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="divmode4" class="txt_content"> 
                            </div><input type="hidden" id="mode4" name="mode">
                        </td>   
                    </tr>

<!--第五行-->
                    <tr id='tr5' class="bg_row_even" height=20 > 
                    <input type='hidden' id='manufactureunitprice5' name='manufactureunitprice' value=''>
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">
                                <input type='button' class="kuang" value='重置' onclick='resetrow(5);'>
                            </div>
                        </td>
                        <!--集中编码-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" class="txt_content"> 
                                <input type='text' id='concentricityid5' name='concentricityid' size='16' maxlength='20' onKeyDown='checkconcentricityid(5);'>
                                <input type='button' class="kuang" value='查询' onclick='selectManufacture(5);'>
                                <input type='hidden' id='manufactureid5' name='manufactureid' size='7' maxlength='20'>
                                <input type='hidden' id='concentricityid_5' name='concentricityid_'>
                                <input type='hidden' id='manufacturename_5' >
                                <input type='hidden' id='manufacturespec_5' >
                                <input type='hidden' id='manufacturetype_5' >
                                <input type='hidden' id='manufacturebrand_5' >
                                <input type='hidden' id='manufactureunitprice_5' >
                                <input type='hidden' id='manufacturequantunit_5' >
                            </div>
                        </td>
                        <!--产品名称-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" class="txt_content" id='manufacturename5'> 
                            </div>
                        </td>
                        <!--规格-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="spec5" class="txt_content"> 
                            </div>
                        </td>
                        <!--型号-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="type5" class="txt_content"> 
                            </div>
                        </td>
                        <!--品牌-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="brand5" class="txt_content"> 
                            </div>
                        </td>

                        <!--签收数量-->
                        <td class=top align="center"> 
                            <div align="center" class="txt_content"> 
                                <input type="text" id='ordercount5' name='ordercount' size="8" maxlength="11" onKeyUp="formatordercount(5)" onKeyDown="keydown2('signinprice5')">
                            </div>
                        </td>
                        <!--单位-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="quantunit5" class="txt_content"> 
                            </div>
                        </td>                        
                        <!--供应商-->
                        <td class=top align="center" nowrap id='providerid5'> 
                            <div align="center" class="txt_content">                                
                                
                            </div>
                        </td>
                        <!--价格-->
                        <input type="hidden" id='referenceprice5' name='referenceprice' size="6" maxlength="11" >
                        <td class=top align="center"> 
                            <div align='center' class='txt_content'> 
                                <input type="text" id='signinprice5' name='signinprice' size="8" maxlength="11" onKeyUp='checkSignPrice(5)' onKeyDown="keydown2('concentricityid6')">
                            </div>
                        </td>

                        <!--签收总价-->
                        <td class="top" align="center">
                            <div align="center" class="txt_content" id="sum5">
                            </div>
                        </td>
                        <!-- 结算模式 -->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="divmode5" class="txt_content"> 
                            </div><input type="hidden" id="mode5" name="mode">
                        </td>
                    </tr>

<!--第六行-->
                    <tr id='tr6' class="bg_row_odd" height=20 > 
                    <input type='hidden' id='manufactureunitprice6' name='manufactureunitprice' value=''>
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">
                                <input type='button' class="kuang" value='重置' onclick='resetrow(6);'>
                            </div>
                        </td>
                        <!--集中编码-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" class="txt_content"> 
                                <input type='text' id='concentricityid6' name='concentricityid' size='16' maxlength='20' onKeyDown='checkconcentricityid(6);'>
                                <input type='button' class="kuang" value='查询' onclick='selectManufacture(6);'>
                                <input type='hidden' id='manufactureid6' name='manufactureid' size='7' maxlength='20'>
                                <input type='hidden' id='concentricityid_6' name='concentricityid_'>
                                <input type='hidden' id='manufacturename_6' >
                                <input type='hidden' id='manufacturespec_6' >
                                <input type='hidden' id='manufacturetype_6' >
                                <input type='hidden' id='manufacturebrand_6' >
                                <input type='hidden' id='manufactureunitprice_6' >
                                <input type='hidden' id='manufacturequantunit_6' >
                            </div>
                        </td>
                        <!--产品名称-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" class="txt_content" id='manufacturename6'> 
                            </div>
                        </td>
                        <!--规格-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="spec6" class="txt_content"> 
                            </div>
                        </td>
                        <!--型号-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="type6" class="txt_content"> 
                            </div>
                        </td>
                        <!--品牌-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="brand6" class="txt_content"> 
                            </div>
                        </td>

                        <!--签收数量-->
                        <td class=top align="center"> 
                            <div align="center" class="txt_content"> 
                                <input type="text" id='ordercount6' name='ordercount' size="8" maxlength="11" onKeyUp="formatordercount(6)" onKeyDown="keydown2('signinprice6')">
                            </div>
                        </td>
                        <!--单位-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="quantunit6" class="txt_content"> 
                            </div>
                        </td>                        
                        <!--供应商-->
                        <td class=top align="center" nowrap id='providerid6'> 
                            <div align="center" class="txt_content">                                
                                
                            </div>
                        </td>
                        <!--价格-->
                        <input type="hidden" id='referenceprice6' name='referenceprice' size="6" maxlength="11" >
                        <td class=top align="center"> 
                            <div align='center' class='txt_content'> 
                                <input type="text" id='signinprice6' name='signinprice' size="8" maxlength="11" onKeyUp='checkSignPrice(6)' onKeyDown="keydown2('concentricityid7')">
                            </div>
                        </td>

                        <!--签收总价-->
                        <td class="top" align="center">
                            <div align="center" class="txt_content" id="sum6">
                            </div>
                        </td>   
                        <!-- 结算模式 -->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="divmode6" class="txt_content"> 
                            </div><input type="hidden" id="mode6" name="mode">
                        </td>
                    </tr>

<!--第七行-->
                    <tr id='tr7' class="bg_row_even" height=20 > 
                    <input type='hidden' id='manufactureunitprice7' name='manufactureunitprice' value=''>
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">
                                <input type='button' class="kuang" value='重置' onclick='resetrow(7);'>
                            </div>
                        </td>
                        <!--集中编码-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" class="txt_content"> 
                                <input type='text' id='concentricityid7' name='concentricityid' size='16' maxlength='20' onKeyDown='checkconcentricityid(7);'>
                                <input type='button' class="kuang" value='查询' onclick='selectManufacture(7);'>
                                <input type='hidden' id='manufactureid7' name='manufactureid' size='7' maxlength='20'>
                                <input type='hidden' id='concentricityid_7' name='concentricityid_'>
                                <input type='hidden' id='manufacturename_7' >
                                <input type='hidden' id='manufacturespec_7' >
                                <input type='hidden' id='manufacturetype_7' >
                                <input type='hidden' id='manufacturebrand_7' >
                                <input type='hidden' id='manufactureunitprice_7' >
                                <input type='hidden' id='manufacturequantunit_7' >
                            </div>
                        </td>
                        <!--产品名称-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" class="txt_content" id='manufacturename7'> 
                            </div>
                        </td>
                        <!--规格-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="spec7" class="txt_content"> 
                            </div>
                        </td>
                        <!--型号-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="type7" class="txt_content"> 
                            </div>
                        </td>
                        <!--品牌-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="brand7" class="txt_content"> 
                            </div>
                        </td>

                        <!--签收数量-->
                        <td class=top align="center"> 
                            <div align="center" class="txt_content"> 
                                <input type="text" id='ordercount7' name='ordercount' size="8" maxlength="11" onKeyUp="formatordercount(7)" onKeyDown="keydown2('signinprice7')">
                            </div>
                        </td>
                        <!--单位-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="quantunit7" class="txt_content"> 
                            </div>
                        </td>                        
                        <!--供应商-->
                        <td class=top align="center" nowrap id='providerid7'> 
                            <div align="center" class="txt_content">                                
                                
                            </div>
                        </td>
                        <!--价格-->
                        <input type="hidden" id='referenceprice7' name='referenceprice' size="6" maxlength="11" >
                        <td class=top align="center"> 
                            <div align='center' class='txt_content'> 
                                <input type="text" id='signinprice7' name='signinprice' size="8" maxlength="11" onKeyUp='checkSignPrice(7)' onKeyDown="keydown2('concentricityid8')">
                            </div>
                        </td>

                        <!--签收总价-->
                        <td class="top" align="center">
                            <div align="center" class="txt_content" id="sum7">
                            </div>
                        </td>   
                        <!-- 结算模式 -->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="divmode7" class="txt_content"> 
                            </div><input type="hidden" id="mode7" name="mode">
                        </td>
                    </tr>

<!--第八行-->
                    <tr id='tr8' class="bg_row_odd" height=20 > 
                    <input type='hidden' id='manufactureunitprice8' name='manufactureunitprice' value=''>
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">
                                <input type='button' class="kuang" value='重置' onclick='resetrow(8);'>
                            </div>
                        </td>
                        <!--集中编码-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" class="txt_content"> 
                                <input type='text' id='concentricityid8' name='concentricityid' size='16' maxlength='20' onKeyDown='checkconcentricityid(8);'>
                                <input type='button' class="kuang" value='查询' onclick='selectManufacture(8);'>
                                <input type='hidden' id='manufactureid8' name='manufactureid' size='7' maxlength='20'>
                                <input type='hidden' id='concentricityid_8' name='concentricityid_'>
                                <input type='hidden' id='manufacturename_8' >
                                <input type='hidden' id='manufacturespec_8' >
                                <input type='hidden' id='manufacturetype_8' >
                                <input type='hidden' id='manufacturebrand_8' >
                                <input type='hidden' id='manufactureunitprice_8' >
                                <input type='hidden' id='manufacturequantunit_8' >
                            </div>
                        </td>
                        <!--产品名称-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" class="txt_content" id='manufacturename8'> 

                            </div>
                        </td>
                        <!--规格-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="spec8" class="txt_content"> 
                            </div>
                        </td>
                        <!--型号-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="type8" class="txt_content"> 
                            </div>
                        </td>
                        <!--品牌-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="brand8" class="txt_content"> 
                            </div>
                        </td>

                        <!--签收数量-->
                        <td class=top align="center"> 
                            <div align="center" class="txt_content"> 
                                <input type="text" id='ordercount8' name='ordercount' size="8" maxlength="11" onKeyUp="formatordercount(8)" onKeyDown="keydown2('signinprice8')">
                            </div>
                        </td>
                        <!--单位-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="quantunit8" class="txt_content"> 
                            </div>
                        </td>                        
                        <!--供应商-->
                        <td class=top align="center" nowrap id='providerid8'> 
                            <div align="center" class="txt_content">                                
                                
                            </div>
                        </td>
                        <!--价格-->
                        <input type="hidden" id='referenceprice8' name='referenceprice' size="6" maxlength="11" >
                        <td class=top align="center"> 
                            <div align='center' class='txt_content'> 
                                <input type="text" id='signinprice8' name='signinprice' size="8" maxlength="11" onKeyUp='checkSignPrice(8)' onKeyDown="keydown2('concentricityid9')">
                            </div>
                        </td>

                        <!--签收总价-->
                        <td class="top" align="center">
                            <div align="center" class="txt_content" id="sum8">
                            </div>
                        </td>   
                        <!-- 结算模式 -->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="divmode8" class="txt_content"> 
                            </div><input type="hidden" id="mode8" name="mode">
                        </td>
                    </tr>

<!--第九行-->
                    <tr id='tr9' class="bg_row_even" height=20 > 
                    <input type='hidden' id='manufactureunitprice9' name='manufactureunitprice' value=''>
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">
                                <input type='button' class="kuang" value='重置' onclick='resetrow(9);'>
                            </div>
                        </td>
                        <!--集中编码-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" class="txt_content"> 
                                <input type='text' id='concentricityid9' name='concentricityid' size='16' maxlength='20' onKeyDown='checkconcentricityid(9);'>
                                <input type='button' class="kuang" value='查询' onclick='selectManufacture(9);'>
                                <input type='hidden' id='manufactureid9' name='manufactureid' size='7' maxlength='20'>
                                <input type='hidden' id='concentricityid_9' name='concentricityid_'>
                                <input type='hidden' id='manufacturename_9' >
                                <input type='hidden' id='manufacturespec_9' >
                                <input type='hidden' id='manufacturetype_9' >
                                <input type='hidden' id='manufacturebrand_9' >
                                <input type='hidden' id='manufactureunitprice_9' >
                                <input type='hidden' id='manufacturequantunit_9' >
                            </div>
                        </td>
                        <!--产品名称-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" class="txt_content" id='manufacturename9'> 
                            </div>
                        </td>
                        <!--规格-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="spec9" class="txt_content"> 
                            </div>
                        </td>
                        <!--型号-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="type9" class="txt_content"> 
                            </div>
                        </td>
                        <!--品牌-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="brand9" class="txt_content"> 
                            </div>
                        </td>

                        <!--签收数量-->
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">  
                                <input type="text" id='ordercount9' name='ordercount' size="8" maxlength="11" onKeyUp="formatordercount(9)" onKeyDown="keydown2('signinprice9')">
                            </div>
                        </td>
                        <!--单位-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="quantunit9" class="txt_content"> 
                            </div>
                        </td>                        
                        <!--供应商-->
                        <td class=top align="center" nowrap id='providerid9'> 
                            <div align="center" class="txt_content">                                
                                
                            </div>
                        </td>
                        <!--价格-->
                        <input type="hidden" id='referenceprice9' name='referenceprice' size="6" maxlength="11" >
                        <td class=top align="center"> 
                            <div align='center' class='txt_content'> 
                                <input type="text" id='signinprice9' name='signinprice' size="8" maxlength="11" onKeyUp='checkSignPrice(9)' onKeyDown="keydown2('concentricityid10')">
                            </div>
                        </td>

                        <!--签收总价-->
                        <td class="top" align="center">
                            <div align="center" class="txt_content" id="sum9">
                            </div>
                        </td>   
                        <!-- 结算模式 -->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="divmode9" class="txt_content"> 
                            </div><input type="hidden" id="mode9" name="mode">
                        </td>
                    </tr>

<!--第十行-->
                    <tr id='tr10' class="bg_row_odd" height=20 > 

                    <input type='hidden' id='manufactureunitprice10' name='manufactureunitprice' value=''>
                        <td class=top align="center"> 
                            <div align="center" class="txt_content">
                                <input type='button' class="kuang" value='重置' onclick='resetrow(10);'>
                            </div>
                        </td>
                        <!--集中编码-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" class="txt_content"> 
                                <input type='text' id='concentricityid10' name='concentricityid' size='16' maxlength='20' onKeyDown='checkconcentricityid(10);'>
                                <input type='button' class="kuang" value='查询' onclick='selectManufacture(10);'>
                                <input type='hidden' id='manufactureid10' name='manufactureid' size='7' maxlength='20'>
                                <input type='hidden' id='concentricityid_10' name='concentricityid_'>
                                <input type='hidden' id='manufacturename_10' >
                                <input type='hidden' id='manufacturespec_10' >
                                <input type='hidden' id='manufacturetype_10' >
                                <input type='hidden' id='manufacturebrand_10' >
                                <input type='hidden' id='manufactureunitprice_10' >
                                <input type='hidden' id='manufacturequantunit_10' >
                            </div>
                        </td>
                        <!--产品名称-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" class="txt_content" id='manufacturename10'> 

                            </div>
                        </td>
                        <!--规格-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="spec10" class="txt_content"> 
                            </div>
                        </td>
                        <!--型号-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="type10" class="txt_content"> 
                            </div>
                        </td>
                        <!--品牌-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="brand10" class="txt_content"> 
                            </div>
                        </td>

                        <!--签收数量-->
                        <td class=top align="center"> 
                            <div align="center" class="txt_content"> 
                                <input type="text" id='ordercount10' name='ordercount' size="8" maxlength="11" onKeyUp="formatordercount(10)" onKeyDown="keydown2('signinprice10')">
                            </div>
                        </td>
                        <!--单位-->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="quantunit10" class="txt_content"> 
                            </div>
                        </td>
                        <!--供应商-->
                        <td class=top align="center" nowrap id='providerid10'> 
                            <div align="center" class="txt_content">                                
                                
                            </div>
                        </td>
                        <!--价格-->
                        <input type="hidden" id='referenceprice10' name='referenceprice' size="6" maxlength="11" >
                        <td class=top align="center"> 
                            <div align='center' class='txt_content'> 
                                <input type="text" id='signinprice10' name='signinprice' size="8" maxlength="11" onKeyUp='checkSignPrice(10)' onKeyDown="keydown2('aaaaa')">
                            </div>
                        </td>

                        <!--签收总价-->
                        <td class="top" align="center">
                            <div align="center" class="txt_content" id="sum10">
                            </div>
                        </td>   
                        <!-- 结算模式 -->
                        <td class=top align="center" nowrap>                         
                            <div align="center" id="divmode10" class="txt_content"> 
                            </div><input type="hidden" id="mode10" name="mode">
                        </td>
                    </tr>

                    
                    </tbody> 
                </table>
            </td>
        </tr>
    </table>
    <p align="center">  
    </p>
</form>

<table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr>

        <td width=100% align="center" id="submitform">

            <input type="button" class="kuang" id='aaaaa' value="保存并继续录入" onclick="openconfirm('SA');return false;">
            <input type="button" class="kuang" value="保存" onclick="openconfirm('S');return false;">
            <input type='hidden' name='middleview'>
        </td>

    <tr>
</table>

<div style="text-align:center;visibility:hidden" id="queding" name="queding">
<input type="button"  onClick="form1.submit();" class="kuang" value="完成">
</div>
</center>
<iframe id='iframe1' name="iframe1" src="<%=response.encodeURL(root+"/template.jsp")%>" width="0" height="0" frameborder = "0"></iframe>

<script language='javascript'>
    function formatordercount(val){
        var obj = document.getElementById("ordercount"+val);
        var obj_manufacture = document.getElementById("concentricityid"+val).value;

        if(isEmpty(obj.value) && obj_manufacture != null && obj_manufacture != ""){
            //obj.value = 0;
        }
        if(isNaN(obj.value)){
            alert("签收数量必须为数字（包含小数）!");
            return false;       
        }   
        if(document.getElementById("signinprice"+val).value != null && document.getElementById("signinprice"+val).value != ""){
            calculate2(val);
        }

    }
    
    function openconfirm(val){
        if (!judgeStrLen("Textarea1")) return false;
        if(ivmanuf()){
            if(checkNoneableValue()){
                var url="<%=response.encodeURL(root+"/jsp/ordersystem/ordermiddleviewtempwz.jsp")%>?val="+val+"&delivermode="+document.getElementById("delivermode").value+"&balancemode="+document.getElementById("balancemode").value;;
                window.open(url,null," center=Yes, help=No, resizable=Yes, status=Yes, width=960px, height=680px, scrollbars=yes");     
            }
        }
    }
    
    function middleviewsubmit(val){
        if(document.all.middleview.value == "T")
            submitForm(val);
            //alert("开始提交："+val);
    }
    
    function initprovider(var1,var2,var3){
        var tempoption=new Option(var2,var3);
        document.all.providerid.options[var1+1]=tempoption;
    }
    
    function checkSignPrice(val){
        var vsign = document.getElementById("signinprice"+val).value ;
        var vreference = document.getElementById("referenceprice"+val).value ;
        var concentricityid = document.getElementById("concentricityid"+val).value ;
        
        if(concentricityid != null && concentricityid != "" && (vreference == null || vreference == "")){
            document.getElementById("signinprice"+val).value = "";
            alert("请先选择供应商");
            return;
        }
        if(parseFloat(vsign) > parseFloat(vreference)){
            //alert("录入的价格大于设定价格，请重新录入");
            //document.getElementById("signinprice"+val).value = document.getElementById("referenceprice"+val).value;
            //return false;
        }
        if(document.getElementById("ordercount"+val).value != null && document.getElementById("ordercount"+val).value != ""){
            calculate2(val);
        }
    }
    
    function calculate2(index){
        var vcount = parseFloat(document.getElementById("ordercount"+index).value);
        var vsign = parseFloat(document.getElementById("signinprice"+index).value);
        
        var temp  = vcount * vsign;
        document.getElementById("sum"+index).innerHTML = temp.toFixed(4);
        
        calTotalSum();
    }
    
    function calTotalSum(){
        var totsum = 0;
        for(var j=1; j<=10;j++){
            var count = document.getElementById("ordercount"+j).value;
            var price = document.getElementById("signinprice"+j).value;
            if((count == null || count == "") && (price == null || price == "")){
                continue;
            }
            totsum = totsum + parseFloat(count)*parseFloat(price);
        }       
        totalSum.innerText = "总价:"+ totsum.toFixed(4); 
    }
    
    function keydown2(id){
        if(event.keyCode==13) {
            var obj = document.getElementById(id);
            if (obj.type =="radio")
            {
                obj.checked = true;
            }
            obj.focus();
        }
    }
    function judgeStrLen(name)
    {
        var str = document.getElementById(name).value;
        if (str == null || str.length == 0) return true;
        if (StrLen(str)><%=memoLen%>)
        {
            alert("备注长度不能超过<%=memoLen/2%>个汉字！");
            return false;
        }
        return true;
    }   
</script>
</body>
</html>